package xyz.xtt.asset.service;

import java.util.List;

import xyz.xtt.asset.client.request.CancelTransactionRequest;
import xyz.xtt.asset.client.request.ConfirmTransactionRequest;
import xyz.xtt.asset.client.request.MakeTransactionRequest;
import xyz.xtt.asset.client.request.MintRequest;
import xyz.xtt.asset.client.request.TransferActionRequest;
import xyz.xtt.asset.client.request.TransferFromRequest;
import xyz.xtt.asset.client.response.AssetInfo;
import xyz.xtt.asset.client.response.BurnResponse;
import xyz.xtt.asset.client.response.CancelOrderResponse;
import xyz.xtt.asset.client.response.ConfirmOrderResponse;
import xyz.xtt.asset.client.response.MintResponse;
import xyz.xtt.asset.client.response.MyNftPage;
import xyz.xtt.asset.client.response.TransferActionResponse;
import xyz.xtt.asset.client.response.TransferFromResponse;
import xyz.xtt.asset.entity.TblAsset;
import xyz.xtt.asset.entity.TblAssetExt;
import xyz.xtt.asset.entity.TblAssetTransaction;
import xyz.xtt.asset.enums.OrderTypeEnum;
import xyz.xtt.asset.request.AssetTransferFromRequest;
import xyz.xtt.asset.request.BatchTransferFromRequest;
import xyz.xtt.asset.request.BurnRequest;
import xyz.xtt.asset.response.InfoResponse;
import xyz.xtt.asset.response.TransactionResponse;
import xyz.xtt.asset.vo.CreateGorupResult;
import xyz.xtt.asset.vo.CreateGroupRequest;
import xyz.xtt.asset.vo.TransferFromResult;

/**
 * @author huqibo
 * @date 2024/12/24
 */
public interface INftService {

	/**
	 * 铸造
	 * 
	 * @param uid
	 * @param mintRequest
	 * @return
	 */
	MintResponse mint(MintRequest mintRequest, OrderTypeEnum orderType);

	/**
	 * 铸造
	 * 
	 * @param uid
	 * @param mintRequest
	 * @return
	 */
	MintResponse create(MintRequest mintRequest);

	/**
	 * 批量铸造
	 * 
	 * @param uid
	 * @param mintRequest
	 * @return
	 */
	Boolean batchMint(List<MintRequest> mintRequest);

	/**
	 * 转移
	 * 
	 * @param uid
	 * @param transferFromRequest
	 * @return
	 */
	TransferFromResponse transferFrom(String platform, TransferFromRequest transferFromRequest);

	/**
	 * 帐户划转
	 *
	 * @param assetTransferFromRequest
	 * @return
	 */
	Boolean accountTransferFrom(AssetTransferFromRequest assetTransferFromRequest);

	/**
	 * 批量转移
	 * 
	 * @param uid
	 * @param batchTransferFromRequest
	 * @return
	 */
	Boolean batchTransferFrom(String uid, BatchTransferFromRequest batchTransferFromRequest);

	/**
	 * 打包转移
	 * 
	 * @param uid
	 * @param transferFromRequestList
	 * @return
	 */
	Boolean packageTransferFrom(String uid, List<TransferFromRequest> transferFromRequestList);

	/**
	 * 销毁
	 * 
	 * @param uid
	 * @param burnRequest
	 * @return
	 */
	BurnResponse burn(String platform, BurnRequest burnRequest);

	/**
	 * 详情
	 * 
	 * @param uid
	 * @param busiId
	 * @return
	 */
	InfoResponse query(String uid, String busiId);

	/**
	 * 转易记录
	 * 
	 * @param uid
	 * @param type
	 * @param currPage
	 * @param pageSize
	 * @return
	 */
	List<TransactionResponse> transferFromList(String uid, String type, Integer currPage, Integer pageSize);

	/**
	 * 活动划转
	 * 
	 * @param accountNo
	 * @param to
	 * @param orderNo
	 * @param num
	 * @param entitlementId
	 * @param orderPirce
	 * @param bizType
	 * @return
	 */
	TransferFromResult transferFromWithActivity(Long accountNo, Long to, String orderNo, Integer num, Long entitlementId, String bizType);

	/**
	 * 创建交易
	 * 
	 * @param makeOrder
	 * @return
	 */
	TblAssetTransaction makeTransaction(MakeTransactionRequest makeOrder);

	/**
	 * 取消交易
	 * 
	 * @param uid
	 * @param cancelOrderRequest
	 * @return
	 */
	CancelOrderResponse cancelTransaction(CancelTransactionRequest cancelTransactionRequest);

	/**
	 * 确认交易
	 * 
	 * @param confirmOrderRequest
	 * @return
	 */
	ConfirmOrderResponse confirmTransaction(ConfirmTransactionRequest confirmTransactionRequest);

	/**
	 * 重复铸造
	 * 
	 * @param userId
	 * @param asset
	 * @param assetExt
	 * @param orderType
	 * @return
	 */
	TblAssetTransaction repeatMint(Long userId, TblAsset asset, TblAssetExt assetExt, OrderTypeEnum orderType);

	/**
	 * 铸造响应
	 * 
	 * @param assetId
	 * @param goodsId
	 * @param transactionOrderId
	 * @param mintRequest
	 * @return
	 */
	MintResponse minResponse(Long assetId, String goodsId, Long transactionOrderId, MintRequest mintRequest);
	
	boolean isTopTrade(TblAsset asset, Long sellerId);

	/**
	 * 赠送动作管理
	 * 
	 * @param transferActionRequest
	 * @return
	 */
	TransferActionResponse transferAction(TransferActionRequest transferActionRequest);

	/**
	 * @param uid
	 * @param filterZero
	 * @param currPage
	 * @param pageSize
	 * @return
	 */
	MyNftPage list(String platform, String uid, Boolean filterZero, Boolean needAttributes, String filterAssetType, Integer currPage, Integer pageSize);

	/**
	 * 交易详情
	 * 
	 * @param platform
	 * @param bizId
	 * @param ownerId
	 * @param needAttributes
	 * @return
	 */
	AssetInfo assetInfo(String platform, String bizId, Long ownerId, Boolean needAttributes);

	/**
	 * 根据资产ID 创建群聊
	 * 
	 * @param createGroupRequest
	 * @return
	 */
	CreateGorupResult createGorup(CreateGroupRequest createGroupRequest);
	/**
	 * 盲盒资产开盒
	 * @param blindBoxAssetId 盲盒资产id
	 * @return 开出的子资产id
	 */
	TblAsset unBoxAsset(Long blindBoxAssetId);
}
